<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    // 解构赋值
        // let person = {
        //     name:"张三",
        //     age:10,
        //     sex:"男"
        // }
        // let {name,age} = person;
        // console.log(name,age);
        // 数组结构
        // let arr1 = [2,[5,6,7],8];
        // let [a,[b,d],c] = arr1;
        // console.log(d,c)

        		//默认值
		// let {a,b=30}={a:20,b:50}
		// let {a,b=30}={a:20}
		// console.log(a,b)
        //也可以使用剩余运算符(把剩余的属性全部放在res对象中)
        let Person ={
			p1:{
				name:"张三"
			},
			p2:[1,2,3],
			p3:"hello world"
		}
		let {p1,...res} = Person;
		console.log(p1,res);

</script>
</html>